<?php

use yii\db\Migration;

class m170222_013620_create_customer_register_relation extends Migration
{
    public function safeUp()
    {
        $this->createTable('{{%customer_register_relation}}', [
            'id'      => $this->primaryKey() . ' COMMENT \'自动编号\'',
            'site_id' => $this->smallInteger(6)->defaultValue(0) . ' COMMENT \'分店id\'',
            'customer_id' => $this->integer()->notNull()->defaultValue(0) . ' COMMENT \'用户id\'',
            'mode' => $this->smallInteger(2)->defaultValue(0) . ' COMMENT \'所属类型（1共同体 2综合体 3管弦乐）\'',
            'created_at' => $this->integer()->notNull()->defaultValue(0) . ' COMMENT \'创建时间\'',
        ]);
    }

    public function safeDown()
    {
        $this->dropTable('{{%customer_register_relation}}');
    }
}
